<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>具名插槽</title>
</head>

<body>
    <div id="app">
        <computer>
            <!-- 替换插槽name=GPU中的内容 -->
            <div slot="GPU">GTX980Ti</div>
        </computer>
    </div>
    <template id="computerTem">
        <div>
            <slot name="CPU">这里插CPU</slot>
            <slot name="GPU">这里插GPU</slot>
        </div>
    </template>
</body>

</html>
<script src="https://cdn.bootcss.com/vue/2.6.11/vue.min.js"></script>
<script>
    new Vue({
        el: "#app",
        components: {
            "computer": {
                template: "#computerTem"
            }
        }
    })
</script>